package com.example.demo.controller;

import com.example.demo.service.IDemoService;
import com.example.demo.service.TestVinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("cfes")
public class TestController {

    @Autowired
    TestVinService<IDemoService> testVinService;

    @Autowired
    private Map<String, IDemoService> demoServiceMap;


    @GetMapping(value = "/test/{vin}")
    public String testProxiedService(@PathVariable String vin) {
        return testVinService.getServiceByVin(demoServiceMap, vin).doSomething();
    }

}
